home *** CD-ROM | disk | FTP | other *** search
- Path: dispatch.news.demon.net!demon!thesett.demon.co.uk
- From: Andy@thesett.demon.co.uk (Andy Goodwin)
- Newsgroups: comp.lang.c
- Subject: Re: IDE HardDrive Serial Number??
- Date: Thu, 15 Feb 1996 22:32:50 GMT
- Message-ID: <3123b1ac.622770@news.demon.co.uk>
- References: <3102f286.115207123@news.onramp.net>
- NNTP-Posting-Host: thesett.demon.co.uk
- X-NNTP-Posting-Host: thesett.demon.co.uk
- X-Newsreader: Forte Agent .99c/16.141
-
- On Mon, 22 Jan 1996 02:13:36 GMT, redbaron@onramp.net (Ronnie Moller,
- Jr.) wrote:
-
- >I am trying to get the information off an IDE HardDrive, for example
- >the Serial number, and the manufactures model number. If some one
- >could point me in the write direction, I would appreciate it.
- >
- >Ronnie
-
- The following assembler will get the IDE information
-
- MOV AH,0D ; Code will load at 0100h
- MOV DL,80
- INT 13 ; reset hard disk system
- MOV AX,0000 ; issue specify drive 0
- MOV DX,0F6 ; command to SDH port
- OUT DX,AL
- MOV AL,EC ; issue identify drive
- MOV DX,01F7 ; command to
- OUT DX,AL ; command port
-
- ; Wait a second here
- NOP ;
- NOP
- MOV AX,0000 ; issue specify drive 0
- MOV DX,0F6 ; command to SDH port
- OUT DX,AL
- MOV AX,00E4 ; issue read sector buffer
- OUT DX,AL ; command
-
- ; wait a second here
- NOP
- NOP ;
- CLD
- MOV AX,CS ; set up ES:DI to point to
- MOV ES,AX ; current code segment and
- MOV DI,0200 ; offset 0200h for data
- MOV CX,0100 ; loop counter (100h
- MOV DX,01F0 ; set up data port value
- ; address 0130h
-
- IN AX,DX ; read word-wide port
- IN AX,DX ; read word-wide port
- STOSW ; store in data area at
- LOOP 0130 ; loop for all 100h words
-
- ; wait a second
-
- NOP
- NOP
- MOV AX,0D00 ; reset disk system
- MOV DX,0080
- INT 13
-
- ; wait a second
-
-